﻿import request from '/@/utils/request';
enum Api {
  AddKecheng = '/api/kecheng/add',
  DeleteKecheng = '/api/kecheng/delete',
  UpdateKecheng = '/api/kecheng/update',
  PageKecheng = '/api/kecheng/page',
  DetailKecheng = '/api/kecheng/detail',
  ImportKecheng = '/api/kecheng/import',
  GetXuankeTaskXuankeTaskIdDropdown = '/api/kecheng/XuankeTaskXuankeTaskIdDropdown',
  GetTeacherTeacherIdDropdown = '/api/kecheng/TeacherTeacherIdDropdown',
  ListByTeacherId = '/api/kecheng/listByTeacherId',
}

// 增加课程
export const addKecheng = (params?: any) =>
	request({
		url: Api.AddKecheng,
		method: 'post',
		data: params,
	});

// 删除课程
export const deleteKecheng = (params?: any) => 
	request({
			url: Api.DeleteKecheng,
			method: 'post',
			data: params,
		});

// 编辑课程
export const updateKecheng = (params?: any) => 
	request({
			url: Api.UpdateKecheng,
			method: 'post',
			data: params,
		});

// 分页查询课程
export const pageKecheng = (params?: any) => 
	request({
			url: Api.PageKecheng,
			method: 'post',
			data: params,
		});

// 详情课程
export const detailKecheng = (id: any) => 
	request({
			url: Api.DetailKecheng,
			method: 'get',
			data: { id },
		});

export const getXuankeTaskXuankeTaskIdDropdown = () =>
		request({
		url: Api.GetXuankeTaskXuankeTaskIdDropdown,
		method: 'get'
		});
export const getTeacherTeacherIdDropdown = () =>
		request({
		url: Api.GetTeacherTeacherIdDropdown,
		method: 'get'
		});

export const importKecheng = (xuankeTaskId:any,fileId: any) => 
		request({
				url: Api.ImportKecheng,
				method: 'post',
				data: { xuankeTaskId:xuankeTaskId,fileId:fileId },
			});

export const listByTeacherId = () => 
		request({
				url: Api.ListByTeacherId,
				method: 'post'
			});